
import 'package:book_app/feature/loginregister/login_view.dart';
import 'package:book_app/feature/onboard/view/onboard_view.dart';
import 'package:book_app/product/constants/app_strings.dart';
import 'package:book_app/product/localstore/local_storage.dart';
import 'package:book_app/product/provider/app_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:provider/provider.dart';

import 'custom_animation.dart';
import 'feature/devices/home_devices.dart';

void main() async{
  FlutterBluePlus.setLogLevel(LogLevel.verbose, color: true);
  runApp(MultiProvider(
    providers: [
      ...ApplicationProvider.instance.appProviders,
    ],
    child:const MyApp(),
  ));
  configLoading();
}

void configLoading() {
  EasyLoading.instance
    ..displayDuration = const Duration(milliseconds: 2000)
    ..indicatorType = EasyLoadingIndicatorType.fadingCircle
    ..loadingStyle = EasyLoadingStyle.dark
    ..indicatorSize = 45.0
    ..radius = 10.0
    ..progressColor = Colors.yellow
    ..backgroundColor = Colors.green
    ..indicatorColor = Colors.yellow
    ..textColor = Colors.yellow
    ..maskColor = Colors.blue.withOpacity(0.5)
    ..userInteractions = true
    ..dismissOnTap = false
    ..customAnimation = CustomAnimation();
}


class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder:EasyLoading.init(),
      debugShowCheckedModeBanner: false,
      title: AppStrings.appName,
      home: const HomeDevices(),
    );
  }
}
